//
//  SXCustomNavigationStyleManager.m
//  iOS_Router_Runtime
//
//  Created by 王水鑫 on 2018/12/5.
//  Copyright © 2018年 王水鑫. All rights reserved.
//

#import "SXCustomNavigationStyleManager.h"

@implementation SXCustomNavigationStyleManager

// 当从服务器拉取数据时，显示动态效果的NavigationBar标题 - 菊花旋转动画
+ (UIView *)customDynamicTitleViewWhenFetchDataFromServerWithTitleText:(NSString *)titleText {
    UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
    UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(30, 5, 70, 20)];
    title.text = titleText;
    title.textColor = [UIColor whiteColor];
    title.font = [UIFont fontWithName:@"PingFangSC-Medium" size:18];
    [titleView addSubview:title];
    UIActivityIndicatorView * activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
    activityIndicator.frame = CGRectMake(0, 5, 20, 20);
    [activityIndicator startAnimating];
    [titleView addSubview:activityIndicator];
    return titleView;
}

@end
